<script src="/js/cartoon.js" tppe="text/javascript"></script>
<form>
<table class="mlist"  cellpadding="0" width="50%" cellspacing="0" style="float: left">
	<thead align="center">
		<td nowrap>分类id</td>
		<td nowrap>分类名</td>
		<td nowrap>分类排序</td>
		<td nowrap>是否推荐</td>
		<td nowrap>创建时间</td>
		<td nowrap>操作</td>
	</thead>
	<?if($this->ret['data']):?>
	<? foreach ($this->ret['data'] as $row):?>
	<tr align="left">
		<td nowrap ><span id="id_<?=$row['id']?>"><?= $row['id']?></span></td>
		<td nowrap><span id='title_<?=$row['id']?>'><?= $row['cate_name']?></span></td>
		<td nowrap>
		<span id="_rank_<?=$row['id']?>"><?=$row['cate_order']?></span>
		</td>
		<td nowrap>
		<span id="_rank_<?=$row['id']?>"><?=$row['cate_flag']==2?'推荐':'普通'?></span>
		<input type="hidden" id="cate_flag_<?=$row['id']?>" value="<?=$row['cate_flag']?>" />
		</td>
		<td>
		<?=date('Y-m-d H:i',$row['cate_time'])?>
		</td>
		<td nowrap align="left">
		<a href="javascript:void(0);" onclick="Cartoon.edit_cate(<?=$row['id']?>,2)">修改</a>
		<span class='delete-link' id='<?= $row['id']?>'>删除</span>
		</td>
	</tr>
	<? endforeach;?>
     <tr>
         <td colspan="2" align="left"></td>
         <td colspan="3" align="right"></td>
     </tr>
	<?else:?>
	<td colspan="5">还没有添加分类</td>
	<?endif;?>
</table>
</form>
<div style="float:left; padding-left: 10px">
<table class="mlist"  cellpadding="0" width="45%" cellspacing="0" style="float: left">
	<thead align="center">
		<td nowrap colspan="2">添加分类</td>
	</thead>
	<tr align="left">
		<td nowrap>分类名：</td>
		<td nowrap>
		<input class="input_text"  type="text" name="cate_title" id="cate_title"  size="25" />
		<input type="hidden" value="" name="cateid" id="cateid">
		</td>
	</tr>
	<tr align="left">
		<td nowrap>推荐：</td>
		<td nowrap>
		<input type="checkbox" value="2" id="recomm" /> <span style="padding-left:100px;color:#6f6" >选择后，会在前台显示</span>
		</td>
	</tr>
	<tr align="left">
		<td nowrap>分类排序：</td>
		<td nowrap>
		<input class="input_text"  id="cate_order"  type="text" name="cate_order"  size="25" value="0" />
		</td>
	</tr>
	<thead>
	<td colspan="2" align="center"><input type="button" id="btn_cate" onclick="Cartoon.addCate()" value="添加" /></td>
	</thead>
</table>
</div>
<script>
hookDeleteConfirm.hook = function(src){ return $H({_app: 'cartoon', _controller: 'index', _action: 'delCate', id: src.getAttribute('id')}).toQueryString();};
</script>
